home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / autocad / R14801.DXR / 00001_dummy main script.ls next >
Encoding:
Text File  |  1997-04-24  |  3.9 KB  |  134 lines

  1. on startMovie
  2.   global sound_is, resetSound
  3.   if sound_is = 0 then
  4.     soundOFF()
  5.   end if
  6.   if sound_is = 1 then
  7.     soundON()
  8.   end if
  9.   EndAnyRollovers()
  10.   set myFile to new(xtra("fileio"))
  11.   set fileName to "r14text8.txt"
  12.   openFile(myFile, fileName, 1)
  13.   set err to status(myFile)
  14.   if error(myFile, err) <> "OK" then
  15.     alert("The File..." & fileName & " does not exist.")
  16.   else
  17.     set p to getPosition(myFile)
  18.     set l to getLength(myFile)
  19.     set theText to "x"
  20.     repeat while getPosition(myFile) < l
  21.       set theCastNum to readLine(myFile)
  22.       set theCastNum to chars(theCastNum, 1, length(theCastNum) - 1)
  23.       set x to setPosition(myFile, getPosition(myFile) + 1)
  24.       set theNumLines to readLine(myFile)
  25.       set theNumLines to chars(theNumLines, 1, length(theNumLines) - 1)
  26.       repeat with i = 1 to value(theNumLines)
  27.         set theText to readLine(myFile)
  28.         set theText to chars(theText, 2, length(theText) - 1)
  29.         if theText <> EMPTY then
  30.           set theMemType to the type of member value(theCastNum)
  31.           if (theMemType = #richText) or (theMemType = #field) then
  32.             if i = 1 then
  33.               set the text of member value(theCastNum) to theText
  34.             else
  35.               set t to the text of member value(theCastNum) & numToChar(13)
  36.               set t to t & theText
  37.               set the text of member value(theCastNum) to t
  38.             end if
  39.           else
  40.             alert("Cast member " & value(theCastNum) & " is NOT a text cast member and will be skipped.")
  41.           end if
  42.           next repeat
  43.         end if
  44.         alert("We don't want to put a null string into cast member..." & value(theCastNum))
  45.       end repeat
  46.       set x to setPosition(myFile, getPosition(myFile) + 1)
  47.     end repeat
  48.   end if
  49.   closeFile(myFile)
  50.   set myFile to 0
  51.   initWorldMap()
  52. end
  53.  
  54. on stopMovie
  55.   closeWorldMap()
  56. end
  57.  
  58. on soundOFF
  59.   global sound_is
  60.   set sound_is to 0
  61.   set the volume of sound 1 to 0
  62.   set the volume of sound 2 to 0
  63.   duplicate(member "soundoff", the number of member "sound")
  64.   duplicate(member "soundoffroll", the number of member "soundroll")
  65.   duplicate(member "soundoffpush", the number of member "soundpush")
  66.   set the scriptText of member 12 to the text of member "soundrollt"
  67.   set the scriptText of member 13 to the text of member "soundonPusht"
  68.   puppetTransition(3, 0, 128)
  69.   updateStage()
  70.   set the name of member 11 to "sound"
  71.   set the name of member 12 to "soundroll"
  72.   set the name of member 13 to "soundPush"
  73. end
  74.  
  75. on soundON
  76.   global sound_is
  77.   set sound_is to 1
  78.   set the volume of sound 1 to 0
  79.   set the volume of sound 2 to 255
  80.   duplicate(member "soundon", the number of member "sound")
  81.   duplicate(member "soundonroll", the number of member "soundroll")
  82.   duplicate(member "soundonpush", the number of member "soundpush")
  83.   set the scriptText of member 12 to the text of member "soundrollt"
  84.   set the scriptText of member 13 to the text of member "soundoffPusht"
  85.   puppetTransition(3, 0, 128)
  86.   updateStage()
  87.   set the name of member 11 to "sound"
  88.   set the name of member 12 to "soundroll"
  89.   set the name of member 13 to "soundPush"
  90. end
  91.  
  92. on Pauseflash
  93.   global resetSound
  94.   set button1 to 45
  95.   startTimer()
  96.   repeat while the timer < (180 * 60)
  97.     set the member of sprite button1 to member "pauseON"
  98.     puppetTransition(3, 0, 128)
  99.     updateStage()
  100.     set timetick to the ticks
  101.     repeat while the ticks < (timetick + 20)
  102.       if the mouseDown then
  103.         stopPause()
  104.         exit
  105.       end if
  106.     end repeat
  107.     set the member of sprite button1 to member "pauseRoll"
  108.     puppetTransition(3, 0, 128)
  109.     updateStage()
  110.     set timetick to the ticks
  111.     repeat while the ticks < (timetick + 20)
  112.       if the mouseDown then
  113.         stopPause()
  114.         exit
  115.       end if
  116.     end repeat
  117.   end repeat
  118.   stopPause()
  119. end
  120.  
  121. on stopPause
  122.   global resetSound
  123.   if resetSound = 1 then
  124.     soundON()
  125.     set resetSound to 0
  126.   end if
  127.   puppetSprite(45, 0)
  128.   continue()
  129. end
  130.  
  131. on enterFrame
  132.   CheckForRollovers()
  133. end
  134.